package com.rtsffm.rtd.test;

import com.rtsffm.rtd.action.controller.ActionDelegate;
import com.rtsffm.rtd.action.model.annotations.ActionAdopt;
import com.rtsffm.rtd.action.model.annotations.ActionFrameworkEnabled;
import com.rtsffm.rtd.action.model.annotations.ActionIdDelegatePair;
import com.rtsffm.rtd.action.model.annotations.ActionSpecification;

//~--- classes ----------------------------------------------------------------

@ActionFrameworkEnabled
@ActionAdopt(adopt = @ActionIdDelegatePair(actionIds = { "ActionImplementor:sayHello" },
        actionImplClass = ActionDelegateImpl.class))
public class ActionProvider implements ActionDelegate {
    @ActionAdopt(adopt = { @ActionIdDelegatePair(actionIds = { "ActionImplementor:sayHello" },
            actionImplClass = ActionDelegateImpl.class) ,
                           @ActionIdDelegatePair(actionIds = { "ActionProvider:sayHello" },
            actionImplClass = ActionProvider.class) })
    public Object field = new Object();

    //~--- methods ------------------------------------------------------------

    @ActionSpecification(actionId = "ActionProvider:sayHello")
    public void sayHello(Object causer, Object ctx) {
        System.out.println(getClass().getSimpleName() + " - Hello World;hash= " + hashCode() + "; " + ctx);
    }

    //~--- get methods --------------------------------------------------------

    @Override
    public boolean isStillValid() {
        return true;
    }
}
